package some.coupon.admin.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import some.coupon.admin.dao.ACouponDao;
import some.coupon.admin.domain.ACouponCommand;

@Controller
public class checkCou_idController {
	private Logger log = Logger.getLogger(this.getClass());
	
	@Autowired
	private ACouponDao aCouponDao;
	
	@RequestMapping("/cou_idCheck.do")
	public ModelAndView process(@RequestParam String cou_id){
		
		if(log.isDebugEnabled()){
			log.debug("cou_id : " + cou_id);
		}
		
		int count = aCouponDao.checkCou_id(cou_id);
		
		System.out.println(count);
		
		ModelAndView mav = new ModelAndView();
		mav.setViewName("checkCou_id");
		mav.addObject("count", count);
		
		return mav;
	}
	
}
